<%@ page contentType="text/html" language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib  uri="/struts-tags" prefix="s"%>
<div class="pageContent">
		<c:if test="${b_T_Ufp_Project !=null}">
		<form method="post"  action="projectmanagement/EngineerCategory_engineerCategorysetsession" class="pageForm required-validate" onsubmit="return validateCallback(this, ddd);">
		<div class="pageFormContent" layoutH="66">
			<p>
				<label>项目编号：</label>
				<label><input type="text" id="projectNum" name="b_T_Ufp_Project.projectNum"  value="${b_T_Ufp_Project.projectNum}"size="26" readonly="readonly"/></label>
			</p>
			<p>
			<input type="hidden" id="positiontype" name="positiontype" value="${positiontype}"/>
				<label>项目名称：</label>
				<label><input type="text" id="projectName" name="b_T_Ufp_Project.projectName"  value="${b_T_Ufp_Project.projectName}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>饰面：</label>
				<label><input type="text" id="finishes" name="b_T_Ufp_Project.finishes"  value="${b_T_Ufp_Project.finishes}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>单位：</label>
				<label><s:select label="单位" headerKey="平米" headerValue="平米" list="{'件','只','扇','自然间','户','套','片','组','元','个','张','米','项','其它'}" name="b_T_Ufp_Project.unit"    cssStyle="width:165px;" /></label>
			</p>
			<p>
				<label>工程量：</label>
				<label><input type="text" id="quantities" name="b_T_Ufp_Project.quantities"  value="${b_T_Ufp_Project.quantities}"size="26" class="required number"/></label>
			</p>
				<c:choose>
			<c:when test="${b_T_Ufp_Project.status ==0}">
					<p>
						<label>人工费</label>
						<label><input type="text" id="laborCost1" name="b_T_Ufp_Project.laborCost"  value="${b_T_Ufp_Project.laborCost}"size="26" readonly="readonly"/></label>
					</p>
					<p>
						<label>材料费：</label>
						<label>	 <input type="text" id="materialCost1" name="b_T_Ufp_Project.materialCost"  value="${b_T_Ufp_Project.materialCost}"size="26" readonly="readonly"/></label>
					</p>
					<p>
						<label>单价：</label>
						<label><input type="text" id="total1" name="b_T_Ufp_Project.total"  value="${b_T_Ufp_Project.total}"size="26" readonly="readonly"/></label>
					</p>
			</c:when>
			<c:otherwise>
					<p>
						<label>人工费</label>
						<label><input type="text" id="laborCost1" name="b_T_Ufp_Project.laborCost"  value="${b_T_Ufp_Project.laborCost}"size="26" class="required number"/></label>
					</p>
					<p>
						<label>材料费：</label>
						<label>	 <input type="text" id="materialCost1" name="b_T_Ufp_Project.materialCost"  value="${b_T_Ufp_Project.materialCost}"size="26" class="required number"/></label>
					</p>
					<p>
					<label>单价：</label>
						<label><input type="text" id="total1" name="b_T_Ufp_Project.total"  value="${b_T_Ufp_Project.total}"size="26" class="required number"/></label>
					</p>
			</c:otherwise>
			</c:choose>
			<p>
				<label>附加说明：</label>
				<textarea id="remark" name="b_T_Ufp_Project.remark"  cols="60" rows="5"  >${b_T_Ufp_Project.remark}</textarea>
			</p>
			</c:if>
			
			<!-- 2个不同的页面根据对象不同分辨 -->
			
		<c:if test="${b_T_Ufp_EngineerCategory !=null}">
		<form method="post" action="projectmanagement/EngineerCategory_engineerCategoryUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="66">
		<p>
				<label>项目编号：</label>
				<label><input type="text" id="projectNum" name="b_T_Ufp_EngineerCategory.projectNum"  value="${b_T_Ufp_EngineerCategory.projectNum}"size="26" readonly="readonly"/></label>
			</p>
			<p>
			<input type="hidden" id="uuid" name="b_T_Ufp_EngineerCategory.uuid" value="${b_T_Ufp_EngineerCategory.uuid}"/>
			<input type="hidden" id="engineeringUuid" name="b_T_Ufp_EngineerCategory.engineeringUuid" value="${b_T_Ufp_EngineerCategory.engineeringUuid}"/>
				<label>项目名称：</label>
				<label><input type="text" id="projectName" name="b_T_Ufp_EngineerCategory.projectName"  value="${b_T_Ufp_EngineerCategory.projectName}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>饰面：</label>
				<label><input type="text" id="finishes" name="b_T_Ufp_EngineerCategory.finishes"  value="${b_T_Ufp_EngineerCategory.finishes}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>单位：</label>
				<label><s:select label="单位" headerKey="平米" headerValue="平米" list="{'件','只','扇','自然间','户','套','片','组','元','个','张','米','项','其它'}" name="b_T_Ufp_EngineerCategory.unit"    cssStyle="width:165px;" /></label>
			</p>
			<c:choose>
			<c:when test="${isupdate == 'y'}">
			<p>
				<label>人工费：</label>
				<label><input type="text" id="laborCost1" name="b_T_Ufp_EngineerCategory.laborCost"  value="${b_T_Ufp_EngineerCategory.laborCost}"size="26" class="required number"/></label>
			</p>
			<p>
				<label>材料费：</label>
				<label>	 <input type="text" id="materialCost1" name="b_T_Ufp_EngineerCategory.materialCost"  value="${b_T_Ufp_EngineerCategory.materialCost}"size="26" class="required number"/></label>
			</p>
			</c:when>
			<c:otherwise>
			<p>
				<label>人工费：</label>
				<label><input type="text" id="laborCost1" name="b_T_Ufp_EngineerCategory.laborCost"  value="${b_T_Ufp_EngineerCategory.laborCost}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>材料费：</label>
				<label>	 <input type="text" id="materialCost1" name="b_T_Ufp_EngineerCategory.materialCost"  value="${b_T_Ufp_EngineerCategory.materialCost}"size="26" readonly="readonly"/></label>
			</p>
			</c:otherwise>
			</c:choose>
			<p>
				<label>单价：</label>
				<label><input type="text" id="total1" name="b_T_Ufp_EngineerCategory.total"  value="${b_T_Ufp_EngineerCategory.total}"size="26" readonly="readonly" class="number"/></label>
			</p>
			<p>
				<label>工程量：</label>
				<label><input type="text" id="quantities1" name="b_T_Ufp_EngineerCategory.quantities"  value="${b_T_Ufp_EngineerCategory.quantities}"size="26" class="required number"/></label>
			</p>
			<p>
				<label>合计金额：</label>
				<label><input type="text" id="totalAmount1" name="b_T_Ufp_EngineerCategory.totalAmount"  value="${b_T_Ufp_EngineerCategory.totalAmount}"size="26" readonly="readonly"/></label>
			</p>
			<p>
				<label>附加说明：</label>
				<textarea id="remark" name="b_T_Ufp_EngineerCategory.remark"   cols="60" rows="5"  >${b_T_Ufp_EngineerCategory.remark}</textarea>
			</p>
			</c:if>
			
			
		<c:if test="${b_T_Ufp_EngineerCategoryCustom !=null}">
		<form method="post" action="projectmanagement/EngineerCategory_engineerCategoryUpdate" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<div class="pageFormContent" layoutH="66">
			<p>
				<label>项目编号：</label>
				<label><input type="text" id="projectNum" name="b_T_Ufp_EngineerCategory.projectNum"  value="${b_T_Ufp_EngineerCategoryCustom.projectNum}"size="26" class="alphanumeric"/></label>
			</p>
			<p>
			<input type="hidden" id="positionUuid" name="b_T_Ufp_EngineerCategory.positionUuid" value="${b_T_Ufp_EngineerCategoryCustom.positionUuid}"/>
			<input type="hidden" id="positionName" name="b_T_Ufp_EngineerCategory.positionName" value="${b_T_Ufp_EngineerCategoryCustom.positionName}"/>
			<input type="hidden" id="engineeringUuid" name="b_T_Ufp_EngineerCategory.engineeringUuid" value="${b_T_Ufp_EngineerCategoryCustom.engineeringUuid}"/>
				<label>项目名称：</label>
				<label><input type="text" id="projectName" name="b_T_Ufp_EngineerCategory.projectName"  value="${b_T_Ufp_EngineerCategory.projectName}"size="26" /></label>
			</p>
			<p>
				<label>饰面：</label>
				<label><input type="text" id="finishes" name="b_T_Ufp_EngineerCategory.finishes"  value="${b_T_Ufp_EngineerCategory.finishes}"size="26" /></label>
			</p>
			<p>
				<label>单位：</label>
				<label><s:select label="单位" headerKey="平米" headerValue="平米" list="{'件','只','扇','自然间','户','套','片','组','元','个','张','米','项','其它'}" name="b_T_Ufp_EngineerCategory.unit"    cssStyle="width:165px;" class="required"/></label>
			</p>
			<p>
				<label>人工费：</label>
				<label><input type="text" id="laborCost1" name="b_T_Ufp_EngineerCategory.laborCost"  value="${b_T_Ufp_EngineerCategory.laborCost}"size="26"  class="number"/></label>
			</p>
			<p>
				<label>材料费：</label>
				<label>	 <input type="text" id="materialCost1" name="b_T_Ufp_EngineerCategory.materialCost"  value="${b_T_Ufp_EngineerCategory.materialCost}"size="26"  class="number"/></label>
			</p>
			<p>
				<label>单价：</label>
				<label><input type="text" id="total1" name="b_T_Ufp_EngineerCategory.total"  value="${b_T_Ufp_EngineerCategory.total}"size="26"  readonly="readonly" class="number"/></label>
			</p>
			<p>
				<label>工程量：</label>
				<label><input type="text" id="quantities1" name="b_T_Ufp_EngineerCategory.quantities"  value="${b_T_Ufp_EngineerCategory.quantities}"size="26" class="number"/></label>
			</p>
			<p>
				<label>合计金额：</label>
				<label><input type="text" id="totalAmount1" name="b_T_Ufp_EngineerCategory.totalAmount"  value="${b_T_Ufp_EngineerCategory.totalAmount}"size="26" readonly="readonly" class="number"/></label>
			</p>
			<p>
				<label>附加说明：</label>
				<textarea id="remark" name="b_T_Ufp_EngineerCategory.remark"   cols="60" rows="5">${b_T_Ufp_EngineerCategory.remark}</textarea>
			</p>
			</c:if>
		</div>
		<div class="formBar">
			<ul>
				<li><div id="queren"  class="buttonActive"><div class="buttonContent"><button type="button">确认数据</button></div></div></li>
				<li><div  id="submit" class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>

<script type="text/javascript">
$(function() {
		$("#submit").hide();
		$("#queren").click(function(){
			//计算单价
			var num = $("#laborCost1").val();
			var price =$("#materialCost1").val();
			$("#total1").val(parseFloat(num) + parseFloat(price));
			//计算合计金额
			var num = $("#quantities1").val();
			var price =$("#total1").val();
			$("#totalAmount1").val(num*price);
			$("#submit").show();
		});
	});
	
function ddd(){
$.pdialog.closeCurrent();
test();
}
</script>